home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 January / macpower199701.bin / AMUG / Education_15 / CalcWorks 1.5.2.sit / CalcWorks.rsrc / TEXT_212_Help - Binary Functions.txt < prev    next >
Encoding:
Text File  |  1996-04-22  |  2.8 KB  |  40 lines

  1.  
  2. Binary Functions
  3.  
  4. In any of the binary math modes, the number type (signed or unsigned) can be changed using the [SIGN] button, and the word size (byte - 8 bits, word - 16 bits, or long - 32 bits) can be changed using the [SIZE] button. The size changes from B->W->L as you press the [SIZE] button, or from L->W->B if you press the [SIZE] button while the [2nd] button is depressed. The current sign and word size is shown in the display as 窶牢BYTE窶™, 窶篭BYTE窶™, 窶牢WORD窶™, 窶篭WORD窶™, 窶牢LONG窶™, or 窶篭LONG窶™. You can also select the size and sign by using the popup menus that appear if you hold the button down until the menu appears. If the Pad binary numbers option is selected in the Number Format dialog, all numbers displayed in these modes will be padded with leading zeros to the currently selected word size.
  5.  
  6. A displayed number may be truncated or sign-extended when switching word sign or size, depending on the size of the number. If it is truncated, an error message will appear in the display, but you can still continue with the calculation if you wish.
  7.  
  8. Binary math functions are available in [Bin], [Oct], [Dec], and [Hex] modes only and are as follows...
  9.  
  10.   [AND]  Bit wise AND
  11.   [OR ]  Bit wise OR
  12.   [XOR]  Bit wise exclusive OR
  13.   [MOD]  Modulus (division remainder)
  14.   [NOT]  One's complement
  15.   [NEG]  Negate (two's complement)
  16.   [ASL]  Arithmetic shift left
  17.   [ASR]  Arithmetic shift right
  18.   [LSL]  Logical shift left
  19.   [LSR]  Logical shift right
  20.   [ROL]  Rotate left
  21.   [ROR]  Rotate right
  22.   [ASLx] Arithmetic shift left 窶˜x窶™ bits
  23.   [ASRx] Arithmetic shift right 窶˜x窶™ bits
  24.   [LSLx] Logical shift left 窶˜x窶™ bits
  25.   [LSRx] Logical shift right 窶˜x窶™ bits
  26.   [ROLx] Rotate left 窶˜x窶™ bits
  27.   [RORx] Rotate right 窶˜x窶™ bits
  28.  
  29. The last six operations (shift and rotate 窶˜x窶™ operations) use locking buttons, similar to the extended memory functions. Press the button and the button locks, then press a number button 0-9 or A-F, and the operation is completed. Shifts or rotates of 1 to 16 bits are possible with these operations (pressing the 0 button shifts 16 bits). The number of bit positions is also selectable from the popup menu for each button.
  30.  
  31. All operations in this mode (except as noted) execute the corresponding 680x0 instruction directly and then check the CPU condition codes and display the codes in the display. For multiplication, division, and modulus operations, the operation is carried out using floating point arithmetic, then the result is moved into a data register, and the condition codes are checked and displayed. The condition codes displayed are...
  32.  
  33.     C    Carry
  34.     V    oVerflow (result overflow)
  35.     Z    Zero (result is zero)
  36.     N    Negative (high-order bit is set)
  37.  
  38. An upper case character indicates the condition is true (bit set), while lower case indicates false (bit cleared). 
  39.  
  40.